package com.jbm.core.common;

import com.google.protobuf.ByteString;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;

/**
 * Created by root on 17-3-23.
 */
public class Cast
{
	public final static HashMap<Class<?>,HashMap<Class<?>,Method>> g_castmap
			= new HashMap<Class<?>,HashMap<Class<?>,Method>>();
	public final static HashMap<Class<?>,Class<?>> g_typemap = new HashMap<Class<?>,Class<?>>();

	static
	{
		g_typemap.put(Integer.class,int.class);
		g_typemap.put(int.class,int.class);
		HashMap<Class<?>,Method> mdmap = null;

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2boolean",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2Boolean",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2byte",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2Byte",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2short",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2Short",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2int",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2Integer",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2long",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2Long",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2float",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2Float",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2double",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2Double",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2String",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2ByteString",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2Timestamp",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2Date",boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("boolean2BigDecimal",boolean.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(boolean.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2boolean",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2Boolean",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2byte",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2Byte",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2short",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2Short",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2int",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2Integer",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2long",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2Long",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2float",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2Float",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2double",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2Double",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2String",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2ByteString",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2Timestamp",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2Date",Boolean.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Boolean2BigDecimal",Boolean.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(Boolean.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2boolean",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2Boolean",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2byte",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2Byte",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2short",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2Short",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2int",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2Integer",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2long",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2Long",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2float",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2Float",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2double",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2Double",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2String",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2ByteString",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2Timestamp",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2Date",byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("byte2BigDecimal",byte.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(byte.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2boolean",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2Boolean",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2byte",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2Byte",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2short",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2Short",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2int",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2Integer",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2long",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2Long",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2float",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2Float",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2double",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2Double",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2String",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2ByteString",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2Timestamp",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2Date",Byte.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Byte2BigDecimal",Byte.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(Byte.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2boolean",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2Boolean",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2byte",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2Byte",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2short",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2Short",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2int",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2Integer",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2long",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2Long",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2float",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2Float",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2double",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2Double",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2String",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2ByteString",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2Timestamp",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2Date",short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("short2BigDecimal",short.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(short.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2boolean",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2Boolean",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2byte",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2Byte",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2short",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2Short",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2int",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2Integer",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2long",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2Long",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2float",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2Float",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2double",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2Double",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2String",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2ByteString",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2Timestamp",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2Date",Short.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Short2BigDecimal",Short.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(Short.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2boolean",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2Boolean",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2byte",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2Byte",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2short",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2Short",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2int",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2Integer",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2long",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2Long",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2float",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2Float",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2double",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2Double",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2String",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2ByteString",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2Timestamp",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2Date",int.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("int2BigDecimal",int.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(int.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2boolean",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2Boolean",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2byte",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2Byte",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2short",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2Short",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2int",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2Integer",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2long",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2Long",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2float",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2Float",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2double",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2Double",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2String",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2ByteString",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2Timestamp",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2Date",Integer.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Integer2BigDecimal",Integer.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(Integer.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2boolean",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2Boolean",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2byte",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2Byte",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2short",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2Short",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2int",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2Integer",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2long",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2Long",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2float",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2Float",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2double",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2Double",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2String",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2ByteString",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2Timestamp",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2Date",long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("long2BigDecimal",long.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(long.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2boolean",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2Boolean",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2byte",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2Byte",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2short",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2Short",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2int",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2Integer",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2long",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2Long",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2float",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2Float",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2double",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2Double",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2String",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2ByteString",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2Timestamp",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2Date",Long.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Long2BigDecimal",Long.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(Long.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2boolean",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2Boolean",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2byte",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2Byte",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2short",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2Short",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2int",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2Integer",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2long",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2Long",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2float",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2Float",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2double",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2Double",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2String",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2ByteString",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2Timestamp",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2Date",float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("float2BigDecimal",float.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(float.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2boolean",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2Boolean",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2byte",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2Byte",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2short",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2Short",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2int",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2Integer",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2long",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2Long",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2float",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2Float",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2double",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2Double",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2String",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2ByteString",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2Timestamp",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2Date",Float.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Float2BigDecimal",Float.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(Float.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2boolean",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2Boolean",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2byte",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2Byte",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2short",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2Short",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2int",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2Integer",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2long",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2Long",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2float",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2Float",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2double",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2Double",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2String",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2ByteString",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2Timestamp",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2Date",double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("double2BigDecimal",double.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(double.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2boolean",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2Boolean",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2byte",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2Byte",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2short",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2Short",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2int",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2Integer",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2long",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2Long",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2float",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2Float",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2double",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2Double",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2String",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2ByteString",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2Timestamp",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2Date",Double.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Double2BigDecimal",Double.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(Double.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2boolean",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2Boolean",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2byte",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2Byte",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2short",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2Short",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2int",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2Integer",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2long",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2Long",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2float",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2Float",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2double",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2Double",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2String",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2ByteString",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2Timestamp",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2Date",String.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("String2BigDecimal",String.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(String.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2boolean",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2Boolean",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2byte",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2Byte",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2short",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2Short",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2int",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2Integer",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2long",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2Long",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2float",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2Float",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2double",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2Double",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2String",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2ByteString",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2Timestamp",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2Date",ByteString.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("ByteString2BigDecimal",ByteString.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(ByteString.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2boolean",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2Boolean",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2byte",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2Byte",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2short",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2Short",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2int",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2Integer",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2long",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2Long",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2float",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2Float",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2double",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2Double",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2String",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2ByteString",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2Timestamp",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2Date",Timestamp.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Timestamp2BigDecimal",Timestamp.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(Timestamp.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2boolean",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2Boolean",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2byte",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2Byte",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2short",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2Short",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2int",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2Integer",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2long",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2Long",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2float",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2Float",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2double",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2Double",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2String",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2ByteString",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2Timestamp",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2Date",Date.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("Date2BigDecimal",Date.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(Date.class,mdmap);

		mdmap = new HashMap<Class<?>,Method>();
		try
		{
			mdmap.put(boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2boolean",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Boolean.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2Boolean",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2byte",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Byte.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2Byte",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2short",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Short.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2Short",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(int.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2int",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Integer.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2Integer",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2long",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Long.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2Long",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2float",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Float.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2Float",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2double",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Double.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2Double",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(String.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2String",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(ByteString.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2ByteString",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Timestamp.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2Timestamp",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(Date.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2Date",BigDecimal.class));
		}catch(Exception e)
		{
		}
		try
		{
			mdmap.put(BigDecimal.class,Class.forName("com.jbm.core.common.Cast").getDeclaredMethod("BigDecimal2BigDecimal",BigDecimal.class));
		}catch(Exception e)
		{
		}
		g_castmap.put(BigDecimal.class,mdmap);
	}

	static protected Boolean boolean2boolean(boolean value)
	{
		return value;
	}
	static protected Boolean boolean2Boolean(boolean value)
	{
		return value;
	}
	static protected Byte boolean2byte(boolean value)
	{
		return value?(byte)1:(byte)0;
	}
	static protected Byte boolean2Byte(boolean value)
	{
		return value?(byte)1:(byte)0;
	}
	static protected Short boolean2short(boolean value)
	{
		return value?(short)1:(short)0;
	}
	static protected Short boolean2Short(boolean value)
	{
		return value?(short)1:(short)0;
	}
	static protected Integer boolean2int(boolean value)
	{
		return value?1:0;
	}
	static protected Integer boolean2Integer(boolean value)
	{
		return value?1:0;
	}
	static protected Long boolean2long(boolean value)
	{
		return value?1l:0l;
	}
	static protected Long boolean2Long(boolean value)
	{
		return value?1l:0l;
	}
	static protected Float boolean2float(boolean value)
	{
		return value?1f:0f;
	}
	static protected Float boolean2Float(boolean value)
	{
		return value?1f:0f;
	}
	static protected Double boolean2double(boolean value)
	{
		return value?1d:0d;
	}
	static protected Double boolean2Double(boolean value)
	{
		return value?1d:0d;
	}
	static protected String boolean2String(boolean value)
	{
		return String.valueOf(value);
	}
	static protected ByteString boolean2ByteString(boolean value)
	{
		return ByteString.copyFromUtf8(String.valueOf(value));
	}
	static protected Timestamp boolean2Timestamp(boolean value)
	{
		return null;
	}
	static protected Date boolean2Date(boolean value)
	{
		return null;
	}
	static protected BigDecimal boolean2BigDecimal(boolean value)
	{
		return new BigDecimal(value?1:0);
	}
	static protected Boolean Boolean2boolean(Boolean value)
	{
		return value;
	}
	static protected Boolean Boolean2Boolean(Boolean value)
	{
		return value;
	}
	static protected Byte Boolean2byte(Boolean value)
	{
		return value==null?0:value?(byte)1:(byte)0;
	}
	static protected Byte Boolean2Byte(Boolean value)
	{
		return value==null?null:value?(byte)1:(byte)0;
	}
	static protected Short Boolean2short(Boolean value)
	{
		return value?(short)1:(short)0;
	}
	static protected Short Boolean2Short(Boolean value)
	{
		return value?(short)1:(short)0;
	}
	static protected Integer Boolean2int(Boolean value)
	{
		return value==null?0:value?1:0;
	}
	static protected Integer Boolean2Integer(Boolean value)
	{
		return value==null?null:value?1:0;
	}
	static protected Long Boolean2long(Boolean value)
	{
		return value==null?0l:value?1l:0l;
	}
	static protected Long Boolean2Long(Boolean value)
	{
		return value==null?null:value?1l:0l;
	}
	static protected Float Boolean2float(Boolean value)
	{
		return value==null?0f:value?1f:0f;
	}
	static protected Float Boolean2Float(Boolean value)
	{
		return value==null?null:value?1f:0f;
	}
	static protected Double Boolean2double(Boolean value)
	{
		return value==null?0d:value?1d:0d;
	}
	static protected Double Boolean2Double(Boolean value)
	{
		return value==null?null:value?1d:0d;
	}
	static protected String Boolean2String(Boolean value)
	{
		return value==null?null:String.valueOf((boolean)value);
	}
	static protected ByteString Boolean2ByteString(Boolean value)
	{
		return value==null?null:ByteString.copyFromUtf8(String.valueOf((boolean)value));
	}
	static protected Timestamp Boolean2Timestamp(Boolean value)
	{
		return null;
	}
	static protected Date Boolean2Date(Boolean value)
	{
		return null;
	}
	static protected BigDecimal Boolean2BigDecimal(Boolean value)
	{
		return new BigDecimal(value==null?null:value?1:0);
	}
	static protected Boolean byte2boolean(byte value)
	{
		return value!=0;
	}
	static protected Boolean byte2Boolean(byte value)
	{
		return value!=0;
	}
	static protected Byte byte2byte(byte value)
	{
		return value;
	}
	static protected Byte byte2Byte(byte value)
	{
		return value;
	}
	static protected Short byte2short(byte value)
	{
		return (short)value;
	}
	static protected Short byte2Short(byte value)
	{
		return (short)value;
	}
	static protected Integer byte2int(byte value)
	{
		return (int)value;
	}
	static protected Integer byte2Integer(byte value)
	{
		return (int)value;
	}
	static protected Long byte2long(byte value)
	{
		return (long)value;
	}
	static protected Long byte2Long(byte value)
	{
		return (long)value;
	}
	static protected Float byte2float(byte value)
	{
		return (float)value;
	}
	static protected Float byte2Float(byte value)
	{
		return (float)value;
	}
	static protected Double byte2double(byte value)
	{
		return (double)value;
	}
	static protected Double byte2Double(byte value)
	{
		return (double)value;
	}
	static protected String byte2String(byte value)
	{
		return String.valueOf((int)value);
	}
	static protected ByteString byte2ByteString(byte value)
	{
		ByteBuffer bb = ByteBuffer.allocate(1);
		bb.put(value);
		bb.flip();
		return ByteString.copyFrom(bb);
	}
	static protected Timestamp byte2Timestamp(byte value)
	{
		return new Timestamp((long)value);
	}
	static protected Date byte2Date(byte value)
	{
		return new Date((long)value);
	}
	static protected BigDecimal byte2BigDecimal(byte value)
	{
		return new BigDecimal((int)value);
	}
	static protected Boolean Byte2boolean(Byte value)
	{
		return value!=null&&value!=0;
	}
	static protected Boolean Byte2Boolean(Byte value)
	{
		return value==null?null:value!=0;
	}
	static protected Byte Byte2byte(Byte value)
	{
		return value==null?0:value;
	}
	static protected Byte Byte2Byte(Byte value)
	{
		return value;
	}
	static protected Short Byte2short(Byte value)
	{
		return value==null?(short)0:(short)value;
	}
	static protected Short Byte2Short(Byte value)
	{
		return value==null?null:(short)value;
	}
	static protected Integer Byte2int(Byte value)
	{
		return value==null?0:(int)value;
	}
	static protected Integer Byte2Integer(Byte value)
	{
		return value==null?null:(int)value;
	}
	static protected Long Byte2long(Byte value)
	{
		return value==null?0l:(long)value;
	}
	static protected Long Byte2Long(Byte value)
	{
		return value==null?null:(long)value;
	}
	static protected Float Byte2float(Byte value)
	{
		return value==null?0f:(float)value;
	}
	static protected Float Byte2Float(Byte value)
	{
		return value==null?null:(float)value;
	}
	static protected Double Byte2double(Byte value)
	{
		return value==null?0d:(double)value;
	}
	static protected Double Byte2Double(Byte value)
	{
		return value==null?null:(double)value;
	}
	static protected String Byte2String(Byte value)
	{
		return value==null?null:String.valueOf((int)value);
	}
	static protected ByteString Byte2ByteString(Byte value)
	{
		ByteBuffer bb = null;

		if ( value != null )
		{
			bb = ByteBuffer.allocate(1);
			bb.put(value);
			bb.flip();
		}

		return value==null?null:ByteString.copyFrom(bb);
	}
	static protected Timestamp Byte2Timestamp(Byte value)
	{
		return value==null?null:new Timestamp((long)value);
	}
	static protected Date Byte2Date(Byte value)
	{
		return value==null?null:new Date((long)value);
	}
	static protected BigDecimal Byte2BigDecimal(Byte value)
	{
		return value==null?null:new BigDecimal((int)value);
	}
	static protected Boolean short2boolean(short value)
	{
		return value!=0;
	}
	static protected Boolean short2Boolean(short value)
	{
		return value!=0;
	}
	static protected Byte short2byte(short value)
	{
		return (byte)(value&0xff);
	}
	static protected Byte short2Byte(short value)
	{
		return (byte)(value&0xff);
	}
	static protected Short short2short(short value)
	{
		return value;
	}
	static protected Short short2Short(short value)
	{
		return value;
	}
	static protected Integer short2int(short value)
	{
		return (int)value;
	}
	static protected Integer short2Integer(short value)
	{
		return (int)value;
	}
	static protected Long short2long(short value)
	{
		return (long)value;
	}
	static protected Long short2Long(short value)
	{
		return (long)value;
	}
	static protected Float short2float(short value)
	{
		return (float)value;
	}
	static protected Float short2Float(short value)
	{
		return (float)value;
	}
	static protected Double short2double(short value)
	{
		return (double)value;
	}
	static protected Double short2Double(short value)
	{
		return (double)value;
	}
	static protected String short2String(short value)
	{
		return String.valueOf((int)value);
	}
	static protected ByteString short2ByteString(short value)
	{
		ByteBuffer bb = ByteBuffer.allocate(2);
		bb.putShort(value);
		bb.flip();
		return ByteString.copyFrom(bb);
	}
	static protected Timestamp short2Timestamp(short value)
	{
		return new Timestamp((long)value);
	}
	static protected Date short2Date(short value)
	{
		return new Date((long)value);
	}
	static protected BigDecimal short2BigDecimal(short value)
	{
		return new BigDecimal((int)value);
	}
	static protected Boolean Short2boolean(Short value)
	{
		return value!=null&&value!=0;
	}
	static protected Boolean Short2Boolean(Short value)
	{
		return value==null?null:value!=0;
	}
	static protected Byte Short2byte(Short value)
	{
		return value==null?0:(byte)(value&0xff);
	}
	static protected Byte Short2Byte(Short value)
	{
		return value==null?null:(byte)(value&0xff);
	}
	static protected Short Short2short(Short value)
	{
		return value==null?0:value;
	}
	static protected Short Short2Short(Short value)
	{
		return value==null?null:value;
	}
	static protected Integer Short2int(Short value)
	{
		return value==null?0:(int)value;
	}
	static protected Integer Short2Integer(Short value)
	{
		return value==null?null:(int)value;
	}
	static protected Long Short2long(Short value)
	{
		return value==null?0l:(long)value;
	}
	static protected Long Short2Long(Short value)
	{
		return value==null?null:(long)value;
	}
	static protected Float Short2float(Short value)
	{
		return value==null?0f:(float)value;
	}
	static protected Float Short2Float(Short value)
	{
		return value==null?null:(float)value;
	}
	static protected Double Short2double(Short value)
	{
		return value==null?0d:(double)value;
	}
	static protected Double Short2Double(Short value)
	{
		return value==null?null:(double)value;
	}
	static protected String Short2String(Short value)
	{
		return value==null?null:String.valueOf((int)value);
	}
	static protected ByteString Short2ByteString(Short value)
	{
		ByteBuffer bb = null;

		if ( value != null )
		{
			bb = ByteBuffer.allocate(2);
			bb.putShort(value);
			bb.flip();
		}

		return value==null?null:ByteString.copyFrom(bb);
	}
	static protected Timestamp Short2Timestamp(Short value)
	{
		return value==null?null:new Timestamp((long)value);
	}
	static protected Date Short2Date(Short value)
	{
		return value==null?null:new Date((long)value);
	}
	static protected BigDecimal Short2BigDecimal(Short value)
	{
		return value==null?null:new BigDecimal((int)value);
	}
	static protected Boolean int2boolean(int value)
	{
		return value!=0;
	}
	static protected Boolean int2Boolean(int value)
	{
		return value!=0;
	}
	static protected Byte int2byte(int value)
	{
		return (byte)(value&0xff);
	}
	static protected Byte int2Byte(int value)
	{
		return (byte)(value&0xff);
	}
	static protected Short int2short(int value)
	{
		return (short)(value&0xffff);
	}
	static protected Short int2Short(int value)
	{
		return (short)(value&0xffff);
	}
	static protected Integer int2int(int value)
	{
		return value;
	}
	static protected Integer int2Integer(int value)
	{
		return value;
	}
	static protected Long int2long(int value)
	{
		return (long)value;
	}
	static protected Long int2Long(int value)
	{
		return (long)value;
	}
	static protected Float int2float(int value)
	{
		return (float)value;
	}
	static protected Float int2Float(int value)
	{
		return (float)value;
	}
	static protected Double int2double(int value)
	{
		return (double)value;
	}
	static protected Double int2Double(int value)
	{
		return (double)value;
	}
	static protected String int2String(int value)
	{
		return String.valueOf(value);
	}
	static protected ByteString int2ByteString(int value)
	{
		ByteBuffer bb = ByteBuffer.allocate(4);
		bb.putInt(value);
		bb.flip();
		return ByteString.copyFrom(bb);
	}
	static protected Timestamp int2Timestamp(int value)
	{
		return new Timestamp((long)value);
	}
	static protected Date int2Date(int value)
	{
		return new Date((long)value);
	}
	static protected BigDecimal int2BigDecimal(int value)
	{
		return new BigDecimal((int)value);
	}
	static protected Boolean Integer2boolean(Integer value)
	{
		return value!=null&&value!=0;
	}
	static protected Boolean Integer2Boolean(Integer value)
	{
		return value==null?null:value!=0;
	}
	static protected Byte Integer2byte(Integer value)
	{
		return value==null?0:(byte)(value&0xff);
	}
	static protected Byte Integer2Byte(Integer value)
	{
		return value==null?null:(byte)(value&0xff);
	}
	static protected Short Integer2short(Integer value)
	{
		return value==null?0:(short)(value&0xffff);
	}
	static protected Short Integer2Short(Integer value)
	{
		return value==null?null:(short)(value&0xffff);
	}
	static protected Integer Integer2int(Integer value)
	{
		return value==null?0:value;
	}
	static protected Integer Integer2Integer(Integer value)
	{
		return value;
	}
	static protected Long Integer2long(Integer value)
	{
		return value==null?0l:(long)value;
	}
	static protected Long Integer2Long(Integer value)
	{
		return value==null?null:(long)value;
	}
	static protected Float Integer2float(Integer value)
	{
		return value==null?0f:(float)value;
	}
	static protected Float Integer2Float(Integer value)
	{
		return value==null?null:(float)value;
	}
	static protected Double Integer2double(Integer value)
	{
		return value==null?0d:(double)value;
	}
	static protected Double Integer2Double(Integer value)
	{
		return value==null?null:(double)value;
	}
	static protected String Integer2String(Integer value)
	{
		return String.valueOf((int)value);
	}
	static protected ByteString Integer2ByteString(Integer value)
	{
		ByteBuffer bb = null;

		if ( value != null )
		{
			bb = ByteBuffer.allocate(4);
			bb.putInt(value);
			bb.flip();
		}

		return value==null?null:ByteString.copyFrom(bb);
	}
	static protected Timestamp Integer2Timestamp(Integer value)
	{
		return value==null?null:new Timestamp((long)value);
	}
	static protected Date Integer2Date(Integer value)
	{
		return value==null?null:new Date((long)value);
	}
	static protected BigDecimal Integer2BigDecimal(Integer value)
	{
		return value==null?null:new BigDecimal((int)value);
	}
	static protected Boolean long2boolean(long value)
	{
		return value!=0;
	}
	static protected Boolean long2Boolean(long value)
	{
		return value!=0;
	}
	static protected Byte long2byte(long value)
	{
		return (byte)(value&0xff);
	}
	static protected Byte long2Byte(long value)
	{
		return (byte)(value&0xff);
	}
	static protected Short long2short(long value)
	{
		return (short)(value&0xffff);
	}
	static protected Short long2Short(long value)
	{
		return (short)(value&0xffff);
	}
	static protected Integer long2int(long value)
	{
		return (int)value;
	}
	static protected Integer long2Integer(long value)
	{
		return (int)value;
	}
	static protected Long long2long(long value)
	{
		return value;
	}
	static protected Long long2Long(long value)
	{
		return value;
	}
	static protected Float long2float(long value)
	{
		return (float)value;
	}
	static protected Float long2Float(long value)
	{
		return (float)value;
	}
	static protected Double long2double(long value)
	{
		return (double)value;
	}
	static protected Double long2Double(long value)
	{
		return (double)value;
	}
	static protected String long2String(long value)
	{
		return String.valueOf(value);
	}
	static protected ByteString long2ByteString(long value)
	{
		ByteBuffer bb = ByteBuffer.allocate(8);
		bb.putLong(value);
		bb.flip();
		return ByteString.copyFrom(bb);
	}
	static protected Timestamp long2Timestamp(long value)
	{
		return new Timestamp((long)value);
	}
	static protected Date long2Date(long value)
	{
		return new Date((long)value);
	}
	static protected BigDecimal long2BigDecimal(long value)
	{
		return new BigDecimal((long)value);
	}
	static protected Boolean Long2boolean(Long value)
	{
		return value!=null&&value!=0;
	}
	static protected Boolean Long2Boolean(Long value)
	{
		return value==null?null:value!=0;
	}
	static protected Byte Long2byte(Long value)
	{
		return (byte)(value&0xff);
	}
	static protected Byte Long2Byte(Long value)
	{
		return value==null?null:(byte)(value&0xff);
	}
	static protected Short Long2short(Long value)
	{
		return (short)(value&0xffff);
	}
	static protected Short Long2Short(Long value)
	{
		return value==null?null:(short)(value&0xffff);
	}
	static protected Integer Long2int(Long value)
	{
		return value==null?0:(int)(long)value;
	}
	static protected Integer Long2Integer(Long value)
	{
		return value==null?null:(int)(long)value;
	}
	static protected Long Long2long(Long value)
	{
		return value==null?0:value;
	}
	static protected Long Long2Long(Long value)
	{
		return value;
	}
	static protected Float Long2float(Long value)
	{
		return value==null?0f:(float)value;
	}
	static protected Float Long2Float(Long value)
	{
		return value==null?null:(float)value;
	}
	static protected Double Long2double(Long value)
	{
		return value==null?0d:(double)value;
	}
	static protected Double Long2Double(Long value)
	{
		return value==null?null:(double)value;
	}
	static protected String Long2String(Long value)
	{
		return value==null?null:String.valueOf((long)value);
	}
	static protected ByteString Long2ByteString(Long value)
	{
		ByteBuffer bb = null;

		if ( value != null )
		{
			bb = ByteBuffer.allocate(8);
			bb.putLong(value);
			bb.flip();
		}

		return value==null?null:ByteString.copyFrom(bb);
	}
	static protected Timestamp Long2Timestamp(Long value)
	{
		return value==null?null:new Timestamp((long)value);
	}
	static protected Date Long2Date(Long value)
	{
		return value==null?null:new Date((long)value);
	}
	static protected BigDecimal Long2BigDecimal(Long value)
	{
		return value==null?null:new BigDecimal((long)value);
	}
	static protected Boolean float2boolean(float value)
	{
		return value!=0;
	}
	static protected Boolean float2Boolean(float value)
	{
		return value!=0;
	}
	static protected Byte float2byte(float value)
	{
		return (byte)(((long)value)&0xff);
	}
	static protected Byte float2Byte(float value)
	{
		return (byte)(((long)value)&0xff);
	}
	static protected Short float2short(float value)
	{
		return (short)(((long)value)&0xffff);
	}
	static protected Short float2Short(float value)
	{
		return (short)(((long)value)&0xffff);
	}
	static protected Integer float2int(float value)
	{
		return (int)value;
	}
	static protected Integer float2Integer(float value)
	{
		return (int)value;
	}
	static protected Long float2long(float value)
	{
		return (long)value;
	}
	static protected Long float2Long(float value)
	{
		return (long)value;
	}
	static protected Float float2float(float value)
	{
		return value;
	}
	static protected Float float2Float(float value)
	{
		return value;
	}
	static protected Double float2double(float value)
	{
		return (double)value;
	}
	static protected Double float2Double(float value)
	{
		return (double)value;
	}
	static protected String float2String(float value)
	{
		return String.valueOf(value);
	}
	static protected ByteString float2ByteString(float value)
	{
		ByteBuffer bb = ByteBuffer.allocate(4);
		bb.putFloat(value);
		bb.flip();
		return ByteString.copyFrom(bb);
	}
	static protected Timestamp float2Timestamp(float value)
	{
		return new Timestamp((long)value);
	}
	static protected Date float2Date(float value)
	{
		return new Date((long)value);
	}
	static protected BigDecimal float2BigDecimal(float value)
	{
		return new BigDecimal((double)value);
	}
	static protected Boolean Float2boolean(Float value)
	{
		return value!=null&&value!=0;
	}
	static protected Boolean Float2Boolean(Float value)
	{
		return value==null?null:value!=0;
	}
	static protected Byte Float2byte(Float value)
	{
		return value==null?0:(byte)(((long)(float) value)&0xff);
	}
	static protected Byte Float2Byte(Float value)
	{
		return value==null?null:(byte)(((long)(float) value)&0xff);
	}
	static protected Short Float2short(Float value)
	{
		return value==null?0:(short)(((long)(float) value)&0xffff);
	}
	static protected Short Float2Short(Float value)
	{
		return value==null?null:(short)(((long)(float) value)&0xffff);
	}
	static protected Integer Float2int(Float value)
	{
		return value==null?0:(int)(float)value;
	}
	static protected Integer Float2Integer(Float value)
	{
		return value==null?null:(int)(float)value;
	}
	static protected Long Float2long(Float value)
	{
		return value==null?0:(long)(float)value;
	}
	static protected Long Float2Long(Float value)
	{
		return value==null?null:(long)(float)value;
	}
	static protected Float Float2float(Float value)
	{
		return value==null?0:value;
	}
	static protected Float Float2Float(Float value)
	{
		return value;
	}
	static protected Double Float2double(Float value)
	{
		return value==null?0d:(double)value;
	}
	static protected Double Float2Double(Float value)
	{
		return value==null?null:(double)value;
	}
	static protected String Float2String(Float value)
	{
		return value==null?null:String.valueOf((float)value);
	}
	static protected ByteString Float2ByteString(Float value)
	{
		ByteBuffer bb = null;

		if ( value != null )
		{
			bb = ByteBuffer.allocate(4);
			bb.putFloat(value);
			bb.flip();
		}

		return value==null?null:ByteString.copyFrom(bb);
	}
	static protected Timestamp Float2Timestamp(Float value)
	{
		return value==null?null:new Timestamp(Float2long(value));
	}
	static protected Date Float2Date(Float value)
	{
		return value==null?null:new Date(Float2long(value));
	}
	static protected BigDecimal Float2BigDecimal(Float value)
	{
		return value==null?null:new BigDecimal((double)value);
	}
	static protected Boolean double2boolean(double value)
	{
		return value!=0;
	}
	static protected Boolean double2Boolean(double value)
	{
		return value!=0;
	}
	static protected Byte double2byte(double value)
	{
		return (byte)(((long)value)&0xff);
	}
	static protected Byte double2Byte(double value)
	{
		return (byte)(((long)value)&0xff);
	}
	static protected Short double2short(double value)
	{
		return (short)(((long)value)&0xffff);
	}
	static protected Short double2Short(double value)
	{
		return (short)(((long)value)&0xffff);
	}
	static protected Integer double2int(double value)
	{
		return (int)value;
	}
	static protected Integer double2Integer(double value)
	{
		return (int)value;
	}
	static protected Long double2long(double value)
	{
		return (long)value;
	}
	static protected Long double2Long(double value)
	{
		return (long)value;
	}
	static protected Float double2float(double value)
	{
		return (float)value;
	}
	static protected Float double2Float(double value)
	{
		return (float)value;
	}
	static protected Double double2double(double value)
	{
		return value;
	}
	static protected Double double2Double(double value)
	{
		return value;
	}
	static protected String double2String(double value)
	{
		return String.valueOf(value);
	}
	static protected ByteString double2ByteString(double value)
	{
		ByteBuffer bb = ByteBuffer.allocate(8);
		bb.putDouble(value);
		bb.flip();
		return ByteString.copyFrom(bb);
	}
	static protected Timestamp double2Timestamp(double value)
	{
		return new Timestamp((long)value);
	}
	static protected Date double2Date(double value)
	{
		return new Date((long)value);
	}
	static protected BigDecimal double2BigDecimal(double value)
	{
		return new BigDecimal((double)value);
	}
	static protected Boolean Double2boolean(Double value)
	{
		return value!=null&&value!=0;
	}
	static protected Boolean Double2Boolean(Double value)
	{
		return value==null?null:value!=0;
	}
	static protected Byte Double2byte(Double value)
	{
		return value==null?0:(byte)(((long)(double)value)&0xff);
	}
	static protected Byte Double2Byte(Double value)
	{
		return value==null?null:(byte)(((long)(double)value)&0xff);
	}
	static protected Short Double2short(Double value)
	{
		return value==null?0:(short)(((long)(double)value)&0xffff);
	}
	static protected Short Double2Short(Double value)
	{
		return value==null?null:(short)(((long)(double)value)&0xffff);
	}
	static protected Integer Double2int(Double value)
	{
		return value==null?0:(int)(double)value;
	}
	static protected Integer Double2Integer(Double value)
	{
		return value==null?null:(int)(double)value;
	}
	static protected Long Double2long(Double value)
	{
		return value==null?0:(long)(double)value;
	}
	static protected Long Double2Long(Double value)
	{
		return value==null?null:(long)(double)value;
	}
	static protected Float Double2float(Double value)
	{
		return value==null?0:(float)(double)value;
	}
	static protected Float Double2Float(Double value)
	{
		return value==null?null:(float)(double)value;
	}
	static protected Double Double2double(Double value)
	{
		return value==null?0:value;
	}
	static protected Double Double2Double(Double value)
	{
		return value;
	}
	static protected String Double2String(Double value)
	{
		return value==null?null:String.valueOf((double)value);
	}
	static protected ByteString Double2ByteString(Double value)
	{
		ByteBuffer bb = null;

		if ( value != null )
		{
			bb = ByteBuffer.allocate(8);
			bb.putDouble(value);
			bb.flip();
		}

		return value==null?null:ByteString.copyFrom(bb);
	}
	static protected Timestamp Double2Timestamp(Double value)
	{
		return value==null?null:new Timestamp(Double2long(value));
	}
	static protected Date Double2Date(Double value)
	{
		return value==null?null:new Date(Double2long(value));
	}
	static protected BigDecimal Double2BigDecimal(Double value)
	{
		return value==null?null:new BigDecimal((double)value);
	}
	static protected Boolean String2boolean(String value)
	{
		return value!=null&&Boolean.valueOf(value);
	}
	static protected Boolean String2Boolean(String value)
	{
		return value==null?null:Boolean.valueOf(value);
	}
	static protected Byte String2byte(String value)
	{
		return value==null?0:Byte.valueOf(value);
	}
	static protected Byte String2Byte(String value)
	{
		return value==null?null:Byte.valueOf(value);
	}
	static protected Short String2short(String value)
	{
		return value==null?0:Short.valueOf(value);
	}
	static protected Short String2Short(String value)
	{
		return value==null?null:Short.valueOf(value);
	}
	static protected Integer String2int(String value)
	{
		return value==null?0:Integer.valueOf(value);
	}
	static protected Integer String2Integer(String value)
	{
		return value==null?null:Integer.valueOf(value);
	}
	static protected Long String2long(String value)
	{
		return value==null?0:Long.valueOf(value);
	}
	static protected Long String2Long(String value)
	{
		return value==null?null:Long.valueOf(value);
	}
	static protected Float String2float(String value)
	{
		return value==null?0:Float.valueOf(value);
	}
	static protected Float String2Float(String value)
	{
		return value==null?null:Float.valueOf(value);
	}
	static protected Double String2double(String value)
	{
		return value==null?0:Double.valueOf(value);
	}
	static protected Double String2Double(String value)
	{
		return value==null?null:Double.valueOf(value);
	}
	static protected String String2String(String value)
	{
		return value;
	}
	static protected ByteString String2ByteString(String value)
	{
		return value==null?null:ByteString.copyFromUtf8(value);
	}
	static protected Timestamp String2Timestamp(String value)
	{
		if ( value == null )
			return null;
		try
		{
			return Timestamp.valueOf(value);
		}catch (Exception e)
		{
			return null;
		}
	}
	static protected Date String2Date(String value)
	{
		if ( value == null )
			return null;

		DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		try
		{
			return sdf.parse(value);
		} catch (Exception e)
		{
			return null;
		}
	}
	static protected BigDecimal String2BigDecimal(String value)
	{
		return value==null?null:new BigDecimal(value);
	}
	static protected Boolean ByteString2boolean(ByteString value)
	{
		return value!=null&&Boolean.valueOf(value.toStringUtf8());
	}
	static protected Boolean ByteString2Boolean(ByteString value)
	{
		return value==null?null:Boolean.valueOf(value.toStringUtf8());
	}
	static protected Byte ByteString2byte(ByteString value)
	{
		return value==null?0:value.toByteArray()[0];
	}
	static protected Byte ByteString2Byte(ByteString value)
	{
		return value==null?null:value.toByteArray()[0];
	}
	static protected Short ByteString2short(ByteString value)
	{
		ByteBuffer bb = ByteBuffer.allocate(2);

		if ( value != null )
		{
			value.copyTo(bb);
			bb.flip();
		}
		return value==null?0:bb.getShort();
	}
	static protected Short ByteString2Short(ByteString value)
	{
		ByteBuffer bb = ByteBuffer.allocate(2);

		if ( value != null )
		{
			value.copyTo(bb);
			bb.flip();
		}
		return value==null?null:bb.getShort();
	}
	static protected Integer ByteString2int(ByteString value)
	{
		ByteBuffer bb = ByteBuffer.allocate(4);

		if ( value != null )
		{
			value.copyTo(bb);
			bb.flip();
		}
		return value==null?0:bb.getInt();
	}
	static protected Integer ByteString2Integer(ByteString value)
	{
		ByteBuffer bb = ByteBuffer.allocate(4);

		if ( value != null )
		{
			value.copyTo(bb);
			bb.flip();
		}
		return value==null?null:bb.getInt();
	}
	static protected Long ByteString2long(ByteString value)
	{
		ByteBuffer bb = ByteBuffer.allocate(8);

		if ( value != null )
		{
			value.copyTo(bb);
			bb.flip();
		}
		return value==null?0:bb.getLong();
	}
	static protected Long ByteString2Long(ByteString value)
	{
		ByteBuffer bb = ByteBuffer.allocate(4);

		if ( value != null )
		{
			value.copyTo(bb);
			bb.flip();
		}
		return value==null?null:bb.getLong();
	}
	static protected Float ByteString2float(ByteString value)
	{
		ByteBuffer bb = ByteBuffer.allocate(4);

		if ( value != null )
		{
			value.copyTo(bb);
			bb.flip();
		}
		return value==null?0:bb.getFloat();
	}
	static protected Float ByteString2Float(ByteString value)
	{
		ByteBuffer bb = ByteBuffer.allocate(4);

		if ( value != null )
		{
			value.copyTo(bb);
			bb.flip();
		}
		return value==null?null:bb.getFloat();
	}
	static protected Double ByteString2double(ByteString value)
	{
		ByteBuffer bb = ByteBuffer.allocate(4);

		if ( value != null )
		{
			value.copyTo(bb);
			bb.flip();
		}
		return value==null?0:bb.getDouble();
	}
	static protected Double ByteString2Double(ByteString value)
	{
		ByteBuffer bb = ByteBuffer.allocate(4);

		if ( value != null )
		{
			value.copyTo(bb);
			bb.flip();
		}
		return value==null?null:bb.getDouble();
	}
	static protected String ByteString2String(ByteString value)
	{
		return value==null?null:value.toStringUtf8();
	}
	static protected ByteString ByteString2ByteString(ByteString value)
	{
		return value;
	}
	static protected Timestamp ByteString2Timestamp(ByteString value)
	{
		if ( value == null )
			return null;

		try
		{
			ByteArrayInputStream bais = new ByteArrayInputStream(value.toByteArray());
			ObjectInputStream ois = new ObjectInputStream(bais);
			return (Timestamp)ois.readObject();
		}catch (Exception e)
		{
			return null;
		}
	}
	static protected Date ByteString2Date(ByteString value)
	{
		if ( value == null )
			return null;

		try
		{
			ByteArrayInputStream bais = new ByteArrayInputStream(value.toByteArray());
			ObjectInputStream ois = new ObjectInputStream(bais);
			return (Date)ois.readObject();
		}catch (Exception e)
		{
			return null;
		}
	}
	static protected BigDecimal ByteString2BigDecimal(ByteString value)
	{
		if ( value == null )
			return null;

		try
		{
			ByteArrayInputStream bais = new ByteArrayInputStream(value.toByteArray());
			ObjectInputStream ois = new ObjectInputStream(bais);
			return (BigDecimal)ois.readObject();
		}catch (Exception e)
		{
			return null;
		}
	}
	static protected Boolean Timestamp2boolean(Timestamp value)
	{
		return value!=null;
	}
	static protected Boolean Timestamp2Boolean(Timestamp value)
	{
		return value==null?null:true;
	}
	static protected Byte Timestamp2byte(Timestamp value)
	{
		return value==null?0:long2byte(value.getTime());
	}
	static protected Byte Timestamp2Byte(Timestamp value)
	{
		return value==null?null:long2byte(value.getTime());
	}
	static protected Short Timestamp2short(Timestamp value)
	{
		return value==null?0:long2short(value.getTime());
	}
	static protected Short Timestamp2Short(Timestamp value)
	{
		return value==null?null:long2short(value.getTime());
	}
	static protected Integer Timestamp2int(Timestamp value)
	{
		return value==null?0:long2int(value.getTime());
	}
	static protected Integer Timestamp2Integer(Timestamp value)
	{
		return value==null?null:long2int(value.getTime());
	}
	static protected Long Timestamp2long(Timestamp value)
	{
		return value==null?0:value.getTime();
	}
	static protected Long Timestamp2Long(Timestamp value)
	{
		return value==null?null:value.getTime();
	}
	static protected Float Timestamp2float(Timestamp value)
	{
		return value==null?0:long2float(value.getTime());
	}
	static protected Float Timestamp2Float(Timestamp value)
	{
		return value==null?null:long2float(value.getTime());
	}
	static protected Double Timestamp2double(Timestamp value)
	{
		return value==null?0:long2double(value.getTime());
	}
	static protected Double Timestamp2Double(Timestamp value)
	{
		return value==null?null:long2double(value.getTime());
	}
	static protected String Timestamp2String(Timestamp value)
	{
		return value==null?null:value.toString();
	}
	static protected ByteString Timestamp2ByteString(Timestamp value)
	{
		if ( value == null )
			return null;

		try
		{
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			ObjectOutputStream oos = new ObjectOutputStream(baos);
			oos.writeObject(value);
			return ByteString.copyFrom(baos.toByteArray());
		}catch (Exception e)
		{
			return null;
		}
	}
	static protected Timestamp Timestamp2Timestamp(Timestamp value)
	{
		return value;
	}
	static protected Date Timestamp2Date(Timestamp value)
	{
		return value;
	}
	static protected BigDecimal Timestamp2BigDecimal(Timestamp value)
	{
		return value==null?null:new BigDecimal(value.getTime());
	}
	static protected Boolean Date2boolean(Date value)
	{
		return value!=null;
	}
	static protected Boolean Date2Boolean(Date value)
	{
		return value==null?null:true;
	}
	static protected Byte Date2byte(Date value)
	{
		return value==null?0:long2byte(value.getTime());
	}
	static protected Byte Date2Byte(Date value)
	{
		return value==null?null:long2byte(value.getTime());
	}
	static protected Short Date2short(Date value)
	{
		return value==null?0:long2short(value.getTime());
	}
	static protected Short Date2Short(Date value)
	{
		return value==null?null:long2short(value.getTime());
	}
	static protected Integer Date2int(Date value)
	{
		return value==null?0:long2int(value.getTime());
	}
	static protected Integer Date2Integer(Date value)
	{
		return value==null?null:long2int(value.getTime());
	}
	static protected Long Date2long(Date value)
	{
		return value==null?0:value.getTime();
	}
	static protected Long Date2Long(Date value)
	{
		return value==null?null:value.getTime();
	}
	static protected Float Date2float(Date value)
	{
		return value==null?0:long2float(value.getTime());
	}
	static protected Float Date2Float(Date value)
	{
		return value==null?null:long2float(value.getTime());
	}
	static protected Double Date2double(Date value)
	{
		return value==null?0:long2double(value.getTime());
	}
	static protected Double Date2Double(Date value)
	{
		return value==null?null:long2double(value.getTime());
	}
	static protected String Date2String(Date value)
	{
		if ( value == null )
			return null;

		DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		try
		{
			return sdf.format(value);
		} catch (Exception e)
		{
			return null;
		}
	}
	static protected ByteString Date2ByteString(Date value)
	{
		if ( value == null )
			return null;

		try
		{
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			ObjectOutputStream oos = new ObjectOutputStream(baos);
			oos.writeObject(value);
			return ByteString.copyFrom(baos.toByteArray());
		}catch (Exception e)
		{
			return null;
		}
	}
	static protected Timestamp Date2Timestamp(Date value)
	{
		return value==null?null:new Timestamp(value.getTime());
	}
	static protected Date Date2Date(Date value)
	{
		return value;
	}
	static protected BigDecimal Date2BigDecimal(Date value)
	{
		return value==null?null:new BigDecimal(value.getTime());
	}
	static protected Boolean BigDecimal2boolean(BigDecimal value)
	{
		return value!=null&&value.compareTo(BigDecimal.ZERO)!=0;
	}
	static protected Boolean BigDecimal2Boolean(BigDecimal value)
	{
		return value==null?null:value.compareTo(BigDecimal.ZERO)!=0;
	}
	static protected Byte BigDecimal2byte(BigDecimal value)
	{
		return value==null?0:value.byteValue();
	}
	static protected Byte BigDecimal2Byte(BigDecimal value)
	{
		return value==null?null:value.byteValue();
	}
	static protected Short BigDecimal2short(BigDecimal value)
	{
		return value==null?0:value.shortValue();
	}
	static protected Short BigDecimal2Short(BigDecimal value)
	{
		return value==null?null:value.shortValue();
	}
	static protected Integer BigDecimal2int(BigDecimal value)
	{
		return value==null?0:value.intValue();
	}
	static protected Integer BigDecimal2Integer(BigDecimal value)
	{
		return value==null?null:value.intValue();
	}
	static protected Long BigDecimal2long(BigDecimal value)
	{
		return value==null?0:value.longValue();
	}
	static protected Long BigDecimal2Long(BigDecimal value)
	{
		return value==null?null:value.longValue();
	}
	static protected Float BigDecimal2float(BigDecimal value)
	{
		return value==null?0:value.floatValue();
	}
	static protected Float BigDecimal2Float(BigDecimal value)
	{
		return value==null?null:value.floatValue();
	}
	static protected Double BigDecimal2double(BigDecimal value)
	{
		return value==null?0:value.doubleValue();
	}
	static protected Double BigDecimal2Double(BigDecimal value)
	{
		return value==null?null:value.doubleValue();
	}
	static protected String BigDecimal2String(BigDecimal value)
	{
		return value==null?null:value.toString();
	}
	static protected ByteString BigDecimal2ByteString(BigDecimal value)
	{
		if ( value == null )
			return null;

		try
		{
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			ObjectOutputStream oos = new ObjectOutputStream(baos);
			oos.writeObject(value);
			return ByteString.copyFrom(baos.toByteArray());
		}catch (Exception e)
		{
			return null;
		}
	}
	static protected Timestamp BigDecimal2Timestamp(BigDecimal value)
	{
		return value==null?null:new Timestamp(value.longValue());
	}
	static protected Date BigDecimal2Date(BigDecimal value)
	{
		return value==null?null:new Date(value.longValue());
	}
	static protected BigDecimal BigDecimal2BigDecimal(BigDecimal value)
	{
		return value;
	}
	static public Object Cast ( Object value, Class<?> type )
	{
		if ( value.getClass() == type )
			return value;

		HashMap<Class<?>,Method> mdmap = g_castmap.get(value.getClass());

		if ( mdmap == null )
			if ( value.getClass().getSimpleName().contains("ByteString"))
				mdmap = g_castmap.get(ByteString.class);

		if ( mdmap == null )
			return null;

		Method md = mdmap.get(type);

		if ( md == null )
			return null;

		try
		{
			return md.invoke(null, value);
		}catch (Exception e)
		{
		}

		return null;
	}
}
